import { useState } from 'react'
function Fn(props) {
    const [id, setId] = useState(0)
    const { arr } = props
    let change = (i) => {
        setId(i)
    }
    return (
        arr.map((item, index) => {
            return <button key={index} className={id == index ? "active" : ""} onClick={() => change(index)}>{item}</button>
        })
    )
}
export default Fn